package bean;

import java.math.BigDecimal;

public class CartItem {
    private Integer itemId;         //购物车中商品的id
    private Integer bookId;         //加入购物车的图书id
    private Integer userId;         //购物车的用户id
    private String name;            //图书名
    private Integer count;          //购物车中此图书的数量
    private BigDecimal unitPrice;   //购物车中此类商品的单价
    private BigDecimal totalPrice;  //购物车中此类商品的总价价

    public CartItem() {
    }

    public CartItem(Integer itemId, Integer bookId, Integer userId, String name, Integer count, BigDecimal unitPrice, BigDecimal totalPrice) {
        this.itemId = itemId;
        this.bookId = bookId;
        this.userId = userId;
        this.name = name;
        this.count = count;
        this.unitPrice = unitPrice;
        this.totalPrice = totalPrice;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    @Override
    public String toString() {
        return "CartItem{" +
                "itemId=" + itemId +
                ", bookId=" + bookId +
                ", userId=" + userId +
                ", name='" + name + '\'' +
                ", count=" + count +
                ", unitPrice=" + unitPrice +
                ", totalPrice=" + totalPrice +
                '}';
    }
}
